package com.micro.entity;


import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author micro
 */
@Data
@ToString
public class RequestHeader implements Serializable {
    private static final long serialVersionUID = 525341448616058222L;

    /**
     * 请求头
     */
    private Map<String, String> headers;

    public static class Build{
        private Map<String, String> headers = new HashMap<>();

        public Build addHeader(String headerName,String headerValue){
            this.headers.put(headerName,headerValue);
            return this;
        }
        public RequestHeader build(){
            return new RequestHeader(this);
        }
    }

    public RequestHeader(Build build) {
        this.headers = build.headers;
    }
    public RequestHeader addHeader(String headerName, String headerValue){
        this.headers.put(headerName,headerValue);
        return this;
    }
    public RequestHeader() {
    }

    @Override
    public String toString() {
        return "RequestEntity{" +
//                "url='" + url + '\'' +
                ", headers=" + headers +
                '}';
    }
}
